import math


def calAngle(point_a, point_b, point_c):
    """
    计算∠abc的角度
    :param point_a: a的坐标
    :param point_b: b的坐标
    :param point_c: c的坐标
    :return: ∠abc的角度
    """
    a_x, b_x, c_x = point_a[0], point_b[0], point_c[0]
    a_y, b_y, c_y = point_a[1], point_b[1], point_c[1]
    x1, y1 = (a_x - b_x), (a_y - b_y)
    x2, y2 = (c_x - b_x), (c_y - b_y)
    if (x1 == 0 and y1 == 0) or (x2 == 0 and y2 == 0):
        return "nan"
    cos_b = (x1 * x2 + y1 * y2) / (math.sqrt(x1 ** 2 + y1 ** 2) * (math.sqrt(x2 ** 2 + y2 ** 2)))
    B = math.degrees(math.acos(cos_b))
    return round(B)


def calDistance(point_a, point_b):
    """
    计算ab两点间的距离
    :param point_a: a的坐标
    :param point_b: b的坐标
    :return: ab的距离
    """
    a_x, b_x = point_a[0], point_b[0]
    a_y, b_y = point_a[1], point_b[1]
    x1, y1 = (a_x - b_x), (a_y - b_y)
    dist = math.sqrt(x1 ** 2 + y1 ** 2)
    return round(dist)
